{namespace exports}

/**
 * A template for creating an HTML file that documents an enum and its values.
 * 
 * @param typeName The name of the type.
 * @param? rev The revision being documented.
 * 
 * @param enumDoc The descriptive text for the enum.
 * @param enumType The type expression for each enum value.
 *
 * @param enumVals Array of enum entries, represented as objects with "name",
 *     "value", and "doc" properties.
 *
 * @param? deprecationReason The reason that this enum is deprecated.  If
 *     missing, this means the enum is not deprecated.
 */
{template .toEnumDoc autoescape="false"}
<html>
  <head>
    <title>
      {$typeName} - Enum Documentation
    </title>
    <link href="styles/common.css" rel="stylesheet" type="text/css" />
    <link href="styles/enum.css" rel="stylesheet" type="text/css" />
  </head>
  <body>
    <h1 class="enum-header">Enum: <span class="enum">{$typeName}</span></h1>

    {if $deprecationReason}
      <h3 class="type-deprecation-header">Deprecated</h3>
      <div class="type-deprecation-reason">{$deprecationReason}</div>
    {/if}
    
    <div class="enum-doc">{$enumDoc}</div>
    
    <div class="mono enum-type">Value Type: {lb}{$enumType}{rb}</div>
    
    <div class="enum-values">
      <h3 class="values-head">Enum Values</h3>
        {foreach $entry in $enumVals}
          <div class="mono value">
            <div class="value-head">
              <span class="value-name">
                <a name="{$entry.name}">{$entry.name}</a>
              </span> : {$entry.value|escapeHtml}
            </div>
            <div class="value-desc">{if $entry.doc}
              {$entry.doc}
            {else}
              <em>No description.</em>
            {/if}
            </div>
          </div>
        {ifempty}
          <div class="mono value">This enum has no values.
          </div>
        {/foreach}
      
    </div>
    
    {if $rev}<hr class="footer" /><div class="rev">revision: {$rev}</div>{/if}
  </body>
</html>
{/template}
